package org.ix.gateway.route.service.impl;

import org.ix.gateway.route.service.GatewayRoutesVersionService;
import org.ix.gateway.route.presentation.mapper.GatewayRoutesVersionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 网关路由版本业务逻辑
 *
 * @author 郗世豪（rarexixi@sina.com）
 */
@Service("gatewayRoutesVersionService")
@Transactional
public class GatewayRoutesVersionServiceImpl implements GatewayRoutesVersionService {

    final GatewayRoutesVersionMapper gatewayRoutesVersionMapper;

    @Autowired
    public GatewayRoutesVersionServiceImpl(GatewayRoutesVersionMapper gatewayRoutesVersionMapper) {
        this.gatewayRoutesVersionMapper = gatewayRoutesVersionMapper;
    }

    /**
     * 根据路由最新版本号
     *
     * @return 路由最新版本号
     * @author 郗世豪（rarexixi@sina.com）
     */
    @Override
    public Long getLastVersion() {
        return gatewayRoutesVersionMapper.getLastVersion();
    }
}
